﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using Autodesk.Revit.DB;
using YArchitech.LIB;

namespace YArchitech.HVAC
{
	public partial class FrmLevelSelection : System.Windows.Forms.Form
	{
		public FrmLevelSelection()
		{
			this.InitializeComponent();
			new YJKProcessTools().ShowInTaskbarChange(this);
			base.Icon = Resource.YArchitechIcon;
		}

		public FrmLevelSelection(List<Element> LevelAll)
		{
			this.InitializeComponent();
			new YJKProcessTools().ShowInTaskbarChange(this);
			this.levelAll = LevelAll;
			base.Icon = Resource.YArchitechIcon;
		}

		private void ListBoxBinding(List<Element> LevelAll)
		{
			new List<string>();
			foreach (Element element in LevelAll)
			{
				this.listBox1.Items.Add(((Level)element).Name);
			}
			if (LevelAll.Count > 0)
			{
				this.listBox1.SelectedIndex = 0;
			}
		}

		private void button1_Click(object sender, EventArgs e)
		{
			base.DialogResult = DialogResult.OK;
			this.SelectedLevel = this.listBox1.SelectedItem.ToString();
			base.Close();
		}

		private void button2_Click(object sender, EventArgs e)
		{
			base.DialogResult = DialogResult.Cancel;
			base.Close();
		}

		private List<Element> levelAll;

		public string SelectedLevel = string.Empty;
	}
}
